package cc.messcat.dao.fupin;

import cc.messcat.common.dao.BaseDao;
import cc.messcat.common.model.Pager;
import cc.messcat.entity.fupin.Family;
import cc.messcat.entity.fupin.PoorFamily;
import cc.messcat.entity.fupin.PoorFamilyHistory;
import cc.messcat.entity.system.McUser;
import cc.messcat.entity.vo.PoorFamilyVo;

import java.util.List;
import java.util.Map;

public interface PoorFamilyDao extends BaseDao<PoorFamily>{


	
	/**
	 * 查询贫困户主要致贫原因中，每种原因占的户数有多少
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public  List  queryMainPovertyCauses( );
	
	/**
	 * 查询贫困户收入信息
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public  List  queryIncomeInfo();
	
	/**
	 * 查询贫困人口
	 * @param pageNo  页码
	 * @param pageSize  一页多少行  (pageNo,pageSize都为空或者负数时,查询结果不分页，返回类型为List类型对象，否则返回Pager对象)
	 * @param year  年份
	 * @param town  具体哪个镇(如果该参数为空，则表示查询魏县下每个镇的贫困人口统计，否则就统计具体镇下每个村的贫困人口统计)
	 * @return
	 */
	public Object queryPoorPeople(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	
	/**
	 * 查询贫困人口年龄分组情况
	 * @param pageNo  页码
	 * @param pageSize  一页多少行  (pageNo,pageSize都为空或者负数时,查询结果不分页，返回类型为List类型对象，否则返回Pager对象)
	 * @param year  年份
	 * @param town  具体哪个镇(如果该参数为空，则表示查询魏县下每个镇的贫困人口统计，否则就统计具体镇下每个村的贫困人口统计)
	 * @return
	 */
	public Object queryAgeGroup(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);

	
	/**
	 * 查询贫困人口务工状况统计表
	 * @param user
	 * @param pageNo
	 * @param pageSize
	 * @param year
	 * @param town
	 * @param poverty
	 * @return
	 */
	public Object queryWorkState(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	/**
	 * 查询贫困人口务工时间情况表
	 * @param pageNo
	 * @param pageSize
	 * @param year
	 * @param town
	 * @return
	 */
	public Object queryWorkTime(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	
	
	/**
	 * 查询贫困人口务工时间情况表
	 * @param pageNo
	 * @param pageSize
	 * @param year
	 * @param town
	 * @return
	 */
	public Object queryInternalStudent(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	
	
	/**
	 * 查询贫困户贫困人数
	 * @param pageNo
	 * @param pageSize
	 * @param year
	 * @param town
	 * @param poverty
	 * @return
	 */
	public Object queryPoorStatus(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	
	
	/**
	 * 查询主要致贫的原因
	 * @param user
	 * @param pageNo
	 * @param pageSize
	 * @param year
	 * @param town
	 * @param poverty
	 * @return
	 */
	public Object queryMainPovertyCauses(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	
	
	
	/**
	 * 查询其他致贫的原因
	 * @param user
	 * @param pageNo
	 * @param pageSize
	 * @param year
	 * @param town
	 * @param poverty
	 * @return
	 */
	public Object queryOtherPovertyCauses(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	
	
	
	/**
	 * 贫困学生查询
	 * @return
	 */
	public Pager queryPoorStudent(String year, String country, Family family, Integer pageNo, Integer pageSize, McUser user);

	/**
	 * 户主查询
	 * @param ids
	 * @return
	 */
	public List<Family> findHouseholder(Integer... ids);

	/**
	 * 户主异常
	 * @return
	 */
	public Pager queryExceptHouseholder(String year, String country, String village, Integer type, Integer pageNo, Integer pageSize,
		McUser user);

	/**
	 * 证件号重复查询
	 * @return
	 */
	public Pager<?> queryDuplicateID(Integer pageNo, Integer pageSize, String year, String country, McUser user);

	/**
	 * 贫困户人口规模统计
	 * @return
	 */
	public Pager populationStatistics(McUser user, Integer pageNo, Integer pageSize, String year, String country, String village,
		String poverty);

	/**
	 * 贫困户党员情况统计
	 * @return
	 */
	public Pager CPCStatistics(McUser user, Integer pageNo, Integer pageSize, String year, String country, String village,
		String poverty);

	/**
	 * 贫困户帮扶责任人落实情况统计表
	 */
	public Pager findFamilyLiable(McUser user, Integer pageNo, Integer pageSize, String year, String country,
			String village, String type);

	public void batchSave(Object family, int i);

	public void batchModifyByHql(String string, int i);

	public Long addPoorFamilyHistofy(PoorFamilyHistory poorFamilyHistory);

	public PoorFamilyHistory getLatestPoorFamilyHistory(Long fid);

	public PoorFamilyHistory getPoorFamilyHistory(Long id);

	public void listPoorFamily(StringBuffer sql);

	public  Pager<Map<String, Object>> listPoorFamily(String sql, String countSql, Integer pageNo, Integer pageSize) throws Exception;

	public List<Object> listPoorFamilyCondition(String familyCondition);

	public Pager<?> complexQueryDuplicateIDStatistics(Integer pageNo, Integer pageSize, String year, String country, McUser user);

    Long importPoorFamily(PoorFamily poorFamily);

	public int getCount(String string, Map map);

	public List<PoorFamilyVo> getPoorFamilyVo(Integer pageNo, Integer pageSize, String string, Map map);
}
